package com.dt.utils;

import com.dt.utils.word.WordReporter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 啊涛
 * @version 1.0
 * @date 2021/9/10 10:15
 */
public class Test {
	public static void main( String[] args ) {



		List< Map<String,String> > detailList=new ArrayList<>();
		for ( int i = 0 ; i < 10 ; i++ ) {
			Map<String,String> detailMap = new HashMap<>();
			detailMap.put("gcmc","规程名称 " + i);//规程名称
			detailMap.put("cjr","创建人 " +  i);//创建人
			detailMap.put("bh", "编号 " + i );//编号
			detailMap.put("gzms", "规则描述 " +  i);//规则描述
			detailMap.put("sbmc", "设备名称 " +  i);//设备名称
			detailList.add(detailMap);
		}
		try {
			// 模板文件输入输出地址
			String filePath = "E:\\MyGitCode\\ClassicalDemo\\File\\src\\main\\resources\\template\\akclzhtj.docx";
			String outPath = "C:\\Users\\ThinkPad\\Desktop\\demo1.docx";
			WordReporter wordReporter = new WordReporter();
			wordReporter.setTempLocalPath(filePath);
			wordReporter.init();
			wordReporter.export(detailList,0);
			wordReporter.generate(outPath);


			//            String filePath =wordPath+"/akclzhtj.docx";
			//            String today = DateUtil.today();
			//            String outPath = rootPath+"/综合查询统计信息"+today+".docx";
			//            WordReporter wordReporter = new WordReporter();
			//            wordReporter.setTempLocalPath(filePath);
			//            wordReporter.init();
			//            wordReporter.export(detailList,0);
			//            wordReporter.generate( outPath ,response,"zhtjcx"+today+".docx");

		} catch ( Exception e ) {
			e.printStackTrace( );
		}

	}
}
